package com.pashanhoo.Thread.queue;

import org.apache.tomcat.jni.Time;

import java.util.concurrent.TimeUnit;

/**
 * @author 胡庆安
 * @version V1.0
 * @Package com.pashanhoo.Thread.queue
 * @date 2020/11/24 9:31
 * @Copyright © 2010-2020 爬山虎科技（扬州）股份有限公司
 */
public class Test {
    public static void main(String[] args) {
        HqaQueue queue = new HqaQueue(5);
        for (int i=1;i<=10;i++){
            new Thread(()->{
                queue.put(1);
            }).start();
        }
        for (int i=1;i<=10;i++){
            new Thread(()->{
                queue.take();
            }).start();
        }
    }
}
